package com.lindroy.jetpacknotes.lifecycle.lifecycle_ui.old_way

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.lindroy.jetpacknotes.R

class NoLifecycleActivity : AppCompatActivity() {

    private val locationListener by lazy { LocationListener() }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_no_lifecycle)
    }

    /**
     * 开始定位
     */
    override fun onStart() {
        super.onStart()
        locationListener.startLocate()
    }

    /**
     * 结束定位
     */
    override fun onStop() {
        super.onStop()
        locationListener.stopLocate()
    }
}